package com.ymatou.iapi.marketingmanage.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.ymatou.iapi.marketingmanage.parameter.CreateSellerPromotionBean;
import com.ymatou.iapi.marketingmanage.parameter.Promotion;
import com.ymatou.iapi.marketingmanage.parameter.PromotionPolicy;
import com.ymatou.iapi.marketingmanage.parameter.PromotionValue;
import com.ymatou.iapi.marketingmanage.parameter.SellerPromotionListBean;
import com.ymatou.iapi.marketingmanage.service.SellerPromotionListByStateCall;
import com.ymatou.iapi.marketingmanage.service.SellerPromotionListCall;
import com.ymatou.iapi.trading.operate.parameter.enums.PromotionTypeEnum;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.JSellerPromotionCallService;
import com.ymttest.database.mongo.NewSellerPromotionInfoWapper;
import com.ymttest.database.mongo.YmtBuyerProductWapper;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 促销活动列表 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_SellerPromotionList {
	private static SellerPromotionListBean sellerpromotionlistBean;
	private static SellerPromotionListCall sellerpromotionlistCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("促销活动列表");
	}

	@Before
	public void caseUp() {
		sellerpromotionlistBean = new SellerPromotionListBean();
		sellerpromotionlistCall = new SellerPromotionListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(sellerpromotionlistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void verifyData(SellerPromotionListCall sellerpromotionlistCall2, Map<Integer, CreateSellerPromotionBean> mcspb, Integer sellerid) {
		JsonObject json = sellerpromotionlistCall2.getJsonObject().getAsJsonObject("Data");
		JsonArray ppc = json.get("PromotionProductCountInfo").getAsJsonArray();
		for (JsonElement jsonElement : ppc) {
			JsonObject recjson = jsonElement.getAsJsonObject();
			CreateSellerPromotionBean cspb = mcspb.get(recjson.get("PromotionId").getAsInt());
			Logger.debug(recjson.get("PromotionId").getAsInt() + ":" + FormatUtil.beanToGSONString(cspb));
			if (cspb != null) {
				Logger.verifyEquals(cspb.getPromotionInfo().getProductIds().size(), recjson.get("ProductCount").getAsInt(), "验证sellerid");
			}else{
				Logger.debug("Map中没有发现PromotionId："+recjson.get("PromotionId").getAsInt());
			}
		}
		JsonArray ja = json.get("Promotions").getAsJsonArray();
		for (JsonElement jsonElement : ja) {
			JsonObject recjson = jsonElement.getAsJsonObject();

			Promotion recp = (Promotion) FormatUtil.GSONToObject(recjson.toString(), Promotion.class);
			CreateSellerPromotionBean cspb = mcspb.get(recp.getPromotionId());
			if (cspb != null) {
				PromotionPolicy sendp = cspb.getPromotionInfo();
				Logger.verifyEquals(sellerid, recp.getSellerId(), "验证sellerid");
				Logger.verifyEquals(recp.getPromotionName(), sendp.getPromotionName(), "验证PromotionName");
				Logger.verifyEquals(recp.getPromotionDesc(), sendp.getPromotionDesc(), "验证PromotionDesc");
				Logger.verifyEquals(recp.getPromotionBeginTime().substring(0, 12), sendp.getPromotionBeginTime().substring(0, 12), "验证PromotionBeginTime");
				Logger.verifyEquals(recp.getPromotionEndTime().substring(0, 12), sendp.getPromotionEndTime().substring(0, 12), "验证PromotionEndTime");
				Logger.verifyEquals(recp.getPromotionType(), sendp.getPromotionType(), "验证PromotionType");
				Logger.verifyEquals(recp.getIsSameProductUse(), sendp.getIsSameProductUse(), "验证IsSameProductUse");
				Logger.verifyEquals(recp.getIsLimitProduct(), sendp.getIsLimitProduct(), "验证IsLimitProduct");
				Logger.verifyEquals(recp.getIsSpecifyProduct(), sendp.getIsSpecifyProduct(), "验证IsSpecifyProduct");
				Logger.verifyEquals(recp.getCanUseSellerCoupon(), sendp.getCanUseSellerCoupon(), "验证CanUseSellerCoupon");

				PromotionValue spv = sendp.getPromotionValues().get(0);
				PromotionValue rpv = recp.getPromotionValues().get(0);
				Integer type = sendp.getPromotionType();
				if (type == 1) {
					Logger.verifyEquals(rpv.getQtyCondition(), spv.getQtyCondition(), "验证rv");
					Logger.verifyEquals(rpv.getValue(), spv.getValue(), "验证dv");

				}
				// 折扣的时候/10
				else if (type == 2) {
					Logger.verifyEquals(rpv.getQtyCondition(), spv.getQtyCondition(), "验证rv");
					Logger.verifyEquals(rpv.getValue(), spv.getValue().divide(BigDecimal.valueOf(10)), "验证dv");

				} else if (type == 3) {
					Logger.verifyEquals(rpv.getAmountCondition(), spv.getAmountCondition(), "验证rv");
					Logger.verifyEquals(rpv.getValue(), spv.getValue(), "验证dv");
				} else if (type == 4) {
					Logger.verifyEquals(rpv.getAmountCondition(), spv.getAmountCondition(), "验证rv");
					Logger.verifyEquals(rpv.getValue(), spv.getValue().divide(BigDecimal.valueOf(10)), "验证dv");

				} else if (type == 5) {
					Logger.verifyEquals(2, spv.getQtyCondition(), "验证rv");
					Logger.verifyEquals(new BigDecimal(0.5), spv.getValue(), "验证dv");

				}
			}else{
				Logger.debug("Map中没有发现PromotionId："+recp.getPromotionId());
			}
		}

	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_SellerPromotionList_001() {
		Logger.start(true, "按sellerid查询未来2天促销活动列表成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			cspb.getPromotionInfo().setIsSpecifyProduct(true);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String proid = bpw.get(0).get("ProductId").toString();
			cspb.getPromotionInfo().getProductIds().add(proid);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			//sit 查询速度慢
			int count=0;
			while( json.get("TotalCount").getAsInt()<1){
				count++;
				Logger.debug("重复查询次数:"+count);
				Thread.sleep(1000);
				sellerpromotionlistCall.callService();
				 json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			}
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_SellerPromotionList_002() {
		Logger.start(true, "不输入sellerid，失败");
		try {
			int sellerid = 101;
			// sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyIsContains("无效的买手Id", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", sellerpromotionlistCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_003() {
		Logger.start(true, "不输入开始时间,未查出结果");
		try {
			int sellerid = 101;
			sellerpromotionlistBean.setSellerId(sellerid);
			// sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1,"yyyy-MM-dd
			// HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(0, json.get("TotalCount").getAsInt(), "验证TotalCount");
			Logger.verifyEquals(0, json.get("Promotions").getAsJsonArray().size(), "验证Promotions");
			Logger.verifyEquals(0, json.get("PromotionProductCountInfo").getAsJsonArray().size(), "验证PromotionProductCountInfo");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_004() {
		Logger.start(true, "不输入结束时间,未查出结果");
		try {
			int sellerid = 101;
			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			// sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2,"yyyy-MM-dd
			// HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(0, json.get("TotalCount").getAsInt(), "验证TotalCount");
			Logger.verifyEquals(0, json.get("Promotions").getAsJsonArray().size(), "验证Promotions");
			Logger.verifyEquals(0, json.get("PromotionProductCountInfo").getAsJsonArray().size(), "验证PromotionProductCountInfo");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_005() {
		Logger.start(true, "按促销活动名称查出结果成功");
		try {
			int sellerid = 101;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfAmountEnough);
			cspb.getPromotionInfo().setIsLimitProduct(true);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String proid = bpw.get(0).get("ProductId").toString();
			cspb.getPromotionInfo().getProductIds().add(proid);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionName(cspb.getPromotionInfo().getPromotionName());
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_006() {
		Logger.start(true, "按促销活动名称模糊查出结果成功");
		try {
			int sellerid = 101;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfAmountEnough);
			String pn = "搜索用PN";
			cspb.getPromotionInfo().setPromotionName(pn + TestDataManager.getRandomNum(5));
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionName(pn);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_007() {
		Logger.start(true, "按促销类型type1查询ReduceIfCountEnough成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionType(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_008() {
		Logger.start(true, "按促销类型type2查询DiscountIfCountEnough成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfCountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionType(2);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_009() {
		Logger.start(true, "按促销类型type3查询ReduceIfAmountEnough成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfAmountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionType(3);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_010() {
		Logger.start(true, "按促销类型type4查询DiscountIfAmountEnough成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfAmountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionType(4);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_011() {
		Logger.start(true, "按促销类型type5查询HalfIfCountEnough成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.HalfIfCountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionType(5);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_012() {
		Logger.start(true, "按促销状态PromotionState查询0未开始成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			cspb.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
			cspb.getPromotionInfo().setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(3, YMTDateUtil.YMDTHMS_STRING));
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(0);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_013() {
		Logger.start(true, "按促销状态PromotionState查询1已开始成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_014() {
		Logger.start(true, "按促销状态PromotionState查询2已结束成功");
		try {
			Integer sellerid = 1;
			Integer day=-30;
			ArrayList<Map> a= new NewSellerPromotionInfoWapper().getHistoryPromotion(sellerid,0,YMTDateUtil.getDateBeforeOrNextSecond(day*60*60*24),YMTDateUtil.getDateBeforeOrNextSecond(0));
			int redo=0;
			while(a==null||a.size()==0){
				a= new NewSellerPromotionInfoWapper().getHistoryPromotion(sellerid,0,YMTDateUtil.getDateBeforeOrNextSecond(day*60*60*24),YMTDateUtil.getDateBeforeOrNextSecond(0));
				sellerid++;
				redo++;
				if(redo>100){
					sellerid=3383;
					a= new NewSellerPromotionInfoWapper().getHistoryPromotion(sellerid,0,YMTDateUtil.getDateBeforeOrNextSecond(day*60*60*24),YMTDateUtil.getDateBeforeOrNextSecond(0));
					break;
				}
			}
			Logger.debug(a);
			// JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			// CreateSellerPromotionBean cspb =
			// JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid,
			// PromotionTypeEnum.ReduceIfCountEnough);
			// Integer pid =
			// JSellerPromotionCallService.CreateSellerPromotion(cspb);
			// Map<Integer,CreateSellerPromotionBean> mcspb=new HashMap<Integer,
			// CreateSellerPromotionBean>();
			// mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(day, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(0, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(2);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(json.get("TotalCount").getAsInt(),a.size(), "验证size");
			// "验证TotalCount");
			JsonArray ja = json.get("Promotions").getAsJsonArray();
			for (JsonElement jsonElement : ja) {
				JsonObject recjson = jsonElement.getAsJsonObject();
				Promotion recp = (Promotion) FormatUtil.GSONToObject(recjson.toString(), Promotion.class);
				Logger.verifyIsContains(recp.getPromotionId(),a.toString(),"验证包含promotionid");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_015() {
		Logger.start(true, "按促销状态PromotionState查询3已取消成功");
		try {
			int sellerid = TestDataManager.getRandomIntNum(8) + 100;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			cspb.getPromotionInfo().setPromotionName("满减活动Test");
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);
			// 1->3
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid, pid, 1);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(3);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_016() {
		Logger.start(true, "按促销状态PromotionState查询4提前取消成功");
		try {
			int sellerid = TestDataManager.getRandomIntNum(8) + 100;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			cspb.getPromotionInfo().setPromotionName("满减活动Test");
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);
			// 2->4
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid, pid, 2);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(4);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(1, json.get("TotalCount").getAsInt(), "验证TotalCount");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_017() {
		Logger.start(true, "按促销状态PromotionState查询-1all成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(-1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("TotalCount").getAsInt() > 1, "验证TotalCount>1");
			verifyData(sellerpromotionlistCall, mcspb, sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_018() {
		Logger.start(true, "设置pagesize为2查询第二页成功");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String proid = bpw.get(0).get("ProductId").toString();
			cspb.getPromotionInfo().setIsSpecifyProduct(true);
			cspb.getPromotionInfo().getProductIds().clear();
			cspb.getPromotionInfo().getProductIds().add(proid);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			// page1
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			// page2
			Map<Integer, CreateSellerPromotionBean> mcspb2 = new HashMap<Integer, CreateSellerPromotionBean>();

			mcspb.put(pid, cspb);

			
			CreateSellerPromotionBean cspb2 = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			cspb2.getPromotionInfo().setIsSpecifyProduct(true);
			proid = bpw.get(1).get("ProductId").toString();
			cspb2.getPromotionInfo().getProductIds().clear();
			cspb2.getPromotionInfo().getProductIds().add(proid);
			pid = JSellerPromotionCallService.CreateSellerPromotion(cspb2);

			mcspb.put(pid, cspb2);

			CreateSellerPromotionBean cspb3 = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			cspb3.getPromotionInfo().setIsSpecifyProduct(true);
			proid = bpw.get(2).get("ProductId").toString();
			cspb3.getPromotionInfo().getProductIds().clear();
			cspb3.getPromotionInfo().getProductIds().add(proid);
			pid = JSellerPromotionCallService.CreateSellerPromotion(cspb3);
			Map<Integer, CreateSellerPromotionBean> mcspb3 = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb2.put(pid, cspb3);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(2);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(3, json.get("TotalCount").getAsInt(), "验证TotalCount");
			Logger.verifyEquals(2, json.get("Promotions").getAsJsonArray().size(), "验证Promotions数量");
			Logger.verifyEquals(2, json.get("PromotionProductCountInfo").getAsJsonArray().size(), "验证PromotionProductCountInfo数量");
			 verifyData(sellerpromotionlistCall, mcspb,sellerid);

			sellerpromotionlistBean.setPageIndex(2);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");

			Logger.verifyEquals(3, json.get("TotalCount").getAsInt(), "验证TotalCount");
			Logger.verifyEquals(1, json.get("Promotions").getAsJsonArray().size(), "验证第二页Promotions数量");
			Logger.verifyEquals(1, json.get("PromotionProductCountInfo").getAsJsonArray().size(), "验证第二页PromotionProductCountInfo数量");
			 verifyData(sellerpromotionlistCall, mcspb2,sellerid);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_SellerPromotionList_019() {
		Logger.start(true, "按促销类型type1查询DiscountIfCountEnough失败,没有查询结果");
		try {
			int sellerid = 108;
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);
			CreateSellerPromotionBean cspb = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfCountEnough);
			Integer pid = JSellerPromotionCallService.CreateSellerPromotion(cspb);
			Map<Integer, CreateSellerPromotionBean> mcspb = new HashMap<Integer, CreateSellerPromotionBean>();
			mcspb.put(pid, cspb);

			sellerpromotionlistBean.setSellerId(sellerid);
			sellerpromotionlistBean.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, "yyyy-MM-dd HH:mm:ss"));
			sellerpromotionlistBean.setPageSize(10);
			sellerpromotionlistBean.setPageIndex(1);
			sellerpromotionlistBean.setPromotionState(1);
			sellerpromotionlistBean.setPromotionType(1);
			sellerpromotionlistCall.setData(sellerpromotionlistBean);
			sellerpromotionlistCall.callService();
			Logger.verifyEquals("操作成功", sellerpromotionlistCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", sellerpromotionlistCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", sellerpromotionlistCall.getString("BCode"), "验证BCode");
			JsonObject json = sellerpromotionlistCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(0, json.get("TotalCount").getAsInt(), "验证TotalCount");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}